package ru.spbsu.electromenu.util;

/**
 * Date: 5/2/11
 * Time: 3:12 AM
 *
 * @author Artem Titov
 */
public class StringUtils {
    public static String firstToUpper(final String source) {
        return (source == null) ? null :
                (source.length() == 0) ? "" :
                        new StringBuilder(source.substring(0, 1).toUpperCase())
                                .append((source.length() == 1) ? "" : source.substring(1)).toString();
    }

    public static String firstToLower(final String source) {
        return (source == null) ? null :
                (source.length() == 0) ? "" :
                        new StringBuilder(source.substring(0, 1).toLowerCase())
                                .append((source.length() == 1) ? "" : source.substring(1)).toString();
    }
}
